package com.fulihui.wgj.facade.service.template;

import com.fulihui.common.error.InvokeServiceException;
import com.fulihui.common.request.rpc.AppRequest;
import com.fulihui.common.result.rpc.BaseResult;
import com.fulihui.common.result.rpc.SimpleResult;
import com.fulihui.wgj.facade.dto.WxTemplateDTO;
import com.fulihui.wgj.facade.request.template.TemplateLastUseQueryRequest;
import com.fulihui.wgj.facade.request.template.WxTemplateDeleteRequest;
import com.fulihui.wgj.facade.request.template.WxTemplatePageQueryRequest;
import com.fulihui.wgj.facade.request.template.WxTemplateQueryRequest;
import com.fulihui.wgj.facade.request.template.WxTemplateUpdateRequest;
import com.fulihui.wgj.facade.result.template.WxTemplatePageResult;

import java.util.List;

/**
 * 微信模板Service
 *
 * @author wang_wx
 * @date 2018-07-25
 */
public interface WxTemplateService {

    /**
     * 同步模板
     *
     * @param request
     * @return
     * @throws InvokeServiceException
     */
    BaseResult syncTemplate(AppRequest request) throws InvokeServiceException;

    /**
     * 查询公众号下模板所属行业-二级
     *
     * @param request
     * @return
     * @throws InvokeServiceException
     */
    SimpleResult<List<String>> queryDeputyIndustry(AppRequest request) throws InvokeServiceException;

    /**
     * 分页查询模板消息
     *
     * @param request
     * @return
     * @throws InvokeServiceException
     */
    WxTemplatePageResult pageQueryTemplates(WxTemplatePageQueryRequest request) throws InvokeServiceException;

    /**
     * 删除模板--逻辑删除
     *
     * @param request
     * @return
     * @throws InvokeServiceException
     */
    BaseResult deleteTemplate(WxTemplateDeleteRequest request) throws InvokeServiceException;

    /**
     * 更新模板状态
     *
     * @param request
     * @return
     * @throws InvokeServiceException
     */
    BaseResult updateTemplateStatus(WxTemplateUpdateRequest request) throws InvokeServiceException;

    /**
     * 查询单个模板
     *
     * @param request
     * @return
     * @throws InvokeServiceException
     */
    SimpleResult<WxTemplateDTO> querySingleTemplate(WxTemplateQueryRequest request) throws InvokeServiceException;

    /**
     * 查询上次使用的模板
     *
     * @param request 电商还是游戏 非必传
     * @return 上次使用的模板DTO
     * @throws InvokeServiceException
     */
    SimpleResult<WxTemplateDTO> queryLastUseTemplate(TemplateLastUseQueryRequest request) throws InvokeServiceException;
}
